package cn.aitrox.ry.service.oss.sdk;

import cn.aitrox.ry.bean.RespResult;
import cn.aitrox.ry.service.oss.bean.UrlValidResult;
import cn.aitrox.ry.service.oss.dto.FileRestoreInfoDto;

import java.io.File;
import java.io.InputStream;

public interface OssSdk {

    RespResult<FileRestoreInfoDto> getDownloadUrl(String resourceKey, Integer expireTime);

    RespResult copyFile(String srcKey, String dstKey);

    RespResult putFileByIs(String resourceKey, InputStream is, String oringinFileName);

    RespResult putFile(String resourceKey, File file);

//    RespResult<String> getUrl(String resourceKey, NetworkEnum networkEnum);

    RespResult deleteFile(String key);

    RespResult<File> getFile(String resourceKey, String toFilePath);

    default RespResult<File> getFileByDownloadUrl(String downloadUrl, String toFilePath) {
        return null;
    }

    default RespResult<Long> fileSize(String resourceKey) {
        return RespResult.ok(-1L);
    }

    RespResult moveFile(String key, String filePath);

    UrlValidResult validUrl(String url);
}
